<template>
  <div>
    <h1>温州理工滨海校区</h1>
    <div>
      <input v-model="studentId" placeholder="输入学号" />
      <button @click="searchStudent">搜索</button>
    </div>
    
    <div v-if="studentInfo" class="student-info">
      <h2>学生信息</h2>
      <p>学号: {{ studentInfo.id }}</p>
      <p>姓名: {{ studentInfo.name }}</p>
      <p>年龄: {{ studentInfo.age }}</p>
      <p>专业: {{ studentInfo.major }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      studentId: '',
      studentInfo: null,
      students: [
        { id: '123456', name: '李小明', age: 18, major: '计算机科学' }

      ]
    }
  },
  methods: {
    searchStudent() {
      this.studentInfo = this.students.find(s => s.id === this.studentId);
    }
  }
}
</script>

<style>
.student-info {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
}
</style>